package Operation;

import BOOK.BookList;

/**
 * Creat with IntelliJ IDEA
 * Description:
 * User:WZW
 * Date:2021-11-27
 * Time:18:52
 */
public class Search implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("查找图书：");
        System.out.println("请输入要查找的图书名：>");
        int index = bookList.search(scanner.nextLine());
        if(index==-1){
            System.out.println("很抱歉，没有你要找的书！");
        }else {
            System.out.println("找到了！");
            System.out.println(bookList.getIndex(index));
        }
    }
}
